﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Hangjing.Common;
using Newtonsoft.Json;
using System.Text;
using System.IO;
using Hangjing.Model;
using Hangjing.DBUtility;
using Hangjing.SQLServerDAL;
using System.Collections.Specialized;


/// <summary>
/// 美团门店与ERP绑定接收token回调URL
/// </summary>
public partial class api_meituan_bindcallback : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Clear();
        Response.Write("{\"data\":\"success\"}");
        Hangjing.AppLog.AppLog.Info("美团门店与ERP绑定接收token回调URL");

        System.IO.Stream stream = Request.InputStream;//这是你获得的流
        if (stream != null && stream.Length > 10)
        {

            Hangjing.AppLog.AppLog.Info("stream.Length ：" + stream.Length);
            string jsondata = "";
            using (StreamReader reader = new StreamReader(stream))
            {
                jsondata = reader.ReadToEnd(); ;
            }

            Hangjing.AppLog.AppLog.Info("回调URL信息：" + jsondata);

        }

        meituanbindlogInfo info = new meituanbindlogInfo();
        info.mid = 0;
        info.ePoiId = HjNetHelper.GetPostParam("ePoiId");
        info.appAuthToken = HjNetHelper.GetPostParam("appAuthToken");
        info.addtime = DateTime.Now;
        info.businessId = 0;
        info.mtype = 1;
        info.reveint1 = 0;
        info.reveint2 = 0;
        info.revevar1 = "";
        info.revevar2 = "";

        new meituanbindlog().Add(info);

        Response.End();

    }
}